package com.catazzz.mall.common.exception;

import com.catazzz.mall.common.api.IErrorCode;
import lombok.Getter;

/**
 * @作者: Tao
 * @日期: 2025/4/23
 * @时间: 13:36
 * @描述: 自定义API异常 <pre>
 */
@Getter
public class ApiException extends RuntimeException {
    private IErrorCode errorCode;

    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

}
